package me.ak.sf;

import java.util.Random;
import me.ak.sf.level.Level;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;
import org.newdawn.slick.state.transition.FadeInTransition;
import static resources.Resources.CORNERSLOTH;
import static resources.Resources.FALLINGSLOTH;
import static resources.Resources.SLOTHCLOSEUP;
import static resources.Resources.TURTLE;

public class SlothfallGame extends StateBasedGame {

        public static final String versionString = "YOUR MOTHER!";

        public static Random rand = new Random();

        public static int WIDTH = 800, HEIGHT = 500;

        public static void main(String[] args) throws Exception {

                SlothfallGame theGame = new SlothfallGame("Slothfall, version " + versionString);
                AppGameContainer agc = new AppGameContainer(theGame);
                agc.setDisplayMode(WIDTH, HEIGHT, false);
                agc.setShowFPS(false);
                Level.loadLevels();
                agc.start();

                
        }

        public SlothfallGame(String title) {
                super(title);
        }

        @Override
        public void initStatesList(GameContainer gc) throws SlickException {
                CORNERSLOTH = new Image("resources/sloth_branch1.png");
                SLOTHCLOSEUP = new Image("resources/sloth_closeup1.png");

                FALLINGSLOTH = new Image("resources/sloth_jump1.png");
                TURTLE = new Image("resources/turtle.png");
                
                this.addState(new MenuState());
                this.addState(new SlothfallGameState());
                this.addState(new YouLooseState());

                this.enterState(0, null, new FadeInTransition());
        }

}
